import { defineStore } from "pinia";

export const useUserInfo = defineStore("user", {
  state: () => {
    return { userInfo: {} };
  },
  actions: {
    setUserInfo(info) {
      this.userInfo = info;
    },
  },
  getters: {
    isLogin: (state) => !!state.userInfo?.user_id,
  },
});
